package cn.xyh.service;


import cn.xyh.exception.RoleException;
import cn.xyh.model.Role;

import java.util.List;
import java.util.Map;
import java.util.Set;

public interface IRoleService {

    /**
     * 新增
     */
    public Integer insertRole(Role entity) throws RoleException;

    /**
     * 删除多个
     */
    public Integer delRoleByIds(String primaryKey) throws RoleException;

    /**
     * 删除
     */
    public Integer delRole(long id) throws RoleException;

    /**
     * 修改
     */
    public Integer updateRole(Role entity) throws RoleException;

    /**
     * 根据ID查找对象
     */
    public Role getRoleById(long roleId) throws RoleException;

    /**
     * 根据Code查找对象
     */
    public Role getRoleByCode(String code) throws RoleException;

    /**
     * 根据名称查找对象
     */
    public Role getRoleByName(String name) throws RoleException;

    /**
     * 根据条件查找列表总数
     */
    public Integer getRoleCount(Role entity) throws RoleException;

    /**
     * 根据条件查找列表
     *
     * @param entity      实体对象
     * @param startRownum 开始条数
     * @param endRownum   结束条数
     * @param sortField   排序字段
     * @param sortOrder   正序/倒序
     */
    public List<Role> getRoleList(Role entity) throws RoleException;

    public List<Long> getRoleListById(String currentName) throws RoleException;

    public List<Map<Long,String>> findRoleResourceListByRoleId(Long roleId)throws RoleException;

    public List<Map<Long,String>> findRolePermissionListByRoleId(Long roleId)throws RoleException;
}

